﻿namespace BDRUtils.VerifyCode
{
    public interface IVerifyCode
    {
        /// <summary>
        /// 校验验证码
        /// </summary>
        /// <param name="key">缓存key</param>
        /// <param name="code">验证码</param>
        /// <returns></returns>
        int CheckCode(string key, string code);

        /// <summary>
        /// 获取验证码
        /// </summary>
        /// <param name="key">缓存key</param>
        /// <param name="minutes">验证码有效时间</param>
        /// <param name="maxNumPerAccount">一天之内最多获取验证码次数</param>
        /// <returns></returns>
        string GetCode(string key, int minutes, int maxNumPerAccount);
    }
}
